package ch5;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class Gouwu {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("1.购物超过50元，加1元换购500毫升可乐");
        System.out.println("2:购物超过100元，加2元换购1000毫升果汁");
        System.out.println("3:购物超过100元，加4元换购炫迈口香糖一瓶");
        System.out.println("4:购物超过200元，加38元换购一瓶进口红酒");
        System.out.println("5:购物超过200元，加15元换购1袋面粉");
        System.out.println("0:不换购");

        System.out.println("输入用户的购物金额：");
        int a = in.nextInt();
        System.out.println("输入参与的换购活动：");
        int b = in.nextInt();
        switch (b) {
            case 1:


                int c = in.nextInt();
                switch (c) {
                    case 1:
                        System.out.println("1.购物超过50元，加1元换购500毫升可乐" + (a = a + 1));
                        break;
                    case 2:
                        System.out.println("2:购物超过100元，加2元换购1000毫升果汁" + (a = a + 2));
                        break;
                    case 3:
                        System.out.println("3:购物超过100元，加4元换购炫迈口香糖一瓶" + (a = a + 4));
                        break;
                    case 4:
                        System.out.println("4:购物超过200元，加38元换购一瓶进口红酒" + (a = a + 38));
                        break;
                    case 5:
                        System.out.println("5:购物超过200元，加15元换购1袋面粉" + (a = a + 15));
                        break;
                    case 6:
                        System.out.println("0:不换购");
                        break;


                }
                System.out.println("输出最后换购的商品：" + b);
                System.out.println("实际支付的金额：" + a);
        }
    }
}
